package com.me.study.designPatterns.prototype;

import java.math.BigDecimal;

/**
 * 原型模式：
 *
 * new 和 clone 的性能比对：https://blog.csdn.net/iblade/article/details/80749148
 *
 * @author ME
 */
public class TestPrototype {

    public static void main(String[] args) {
        SomeEntity entity = new SomeEntity(1, 111, "ljy", new BigDecimal("108"));
        System.out.println(entity);

        SomeEntity entity1 = entity.clone();
        entity1.setaInt(2);
        entity1.setaInteger(222);
        entity1.setStr("Tomcat");
        entity1.setDecimal(new BigDecimal("999"));
        System.out.println(entity);
    }

}
